package de.mmis.core.tuplespace;

import de.mmis.core.base.abstracttree.Tree;

/**
 * This exception is thrown on every invalid tuplespace request
 * 
 * @author Martin Nyolt
 * 
 */
public class TuplespaceException extends Exception {

	private static final long serialVersionUID = -283003043783627369L;

	private Tree causingExpression;

	public TuplespaceException() {
		super();
	}

	public TuplespaceException(String message) {
		super(message);
	}

	public TuplespaceException(String message, Throwable cause) {
		super(message, cause);
	}

	public TuplespaceException(Throwable cause) {
		super(cause);
	}

	public TuplespaceException(Tree causingExpression) {
		super();
		this.causingExpression = causingExpression;
	}

	public TuplespaceException(String message, Tree causingExpression) {
		super(message);
		this.causingExpression = causingExpression;
	}

	public TuplespaceException(String message, Throwable cause,
			Tree causingExpression) {
		super(message, cause);
		this.causingExpression = causingExpression;
	}

	public TuplespaceException(Throwable cause, Tree causingExpression) {
		super(cause);
		this.causingExpression = causingExpression;
	}

	/**
	 * @return The {@link Tree} causing this exception, if any
	 */
	public Tree getCausingExpression() {
		return causingExpression;
	}

}
